// Generated from Wezlang.g4 by ANTLR 4.0
package Parser;
import org.antlr.v4.runtime.atn.*;
import org.antlr.v4.runtime.dfa.DFA;
import org.antlr.v4.runtime.*;
import org.antlr.v4.runtime.misc.*;
import org.antlr.v4.runtime.tree.*;
import java.util.List;
import java.util.Iterator;
import java.util.ArrayList;

@SuppressWarnings({"all", "warnings", "unchecked", "unused", "cast"})
public class WezlangParser extends Parser {
	protected static final DFA[] _decisionToDFA;
	protected static final PredictionContextCache _sharedContextCache =
		new PredictionContextCache();
	public static final int
		T__8=1, T__7=2, T__6=3, T__5=4, T__4=5, T__3=6, T__2=7, T__1=8, T__0=9, 
		FOR=10, IF=11, ELSE=12, ELIF=13, STRUCT=14, BOOL=15, OPER_1=16, OPER_2=17, 
		OPER_3=18, OPER_4=19, OPER_R=20, WS=21, TNAME=22, NAME=23, STRING=24, 
		INT=25, FLOAT=26;
	public static final String[] tokenNames = {
		"<INVALID>", "'->'", "'{'", "')'", "','", "'('", "':'", "'='", "'}'", 
		"';'", "'for'", "'if'", "'else'", "'elif'", "'struct'", "BOOL", "OPER_1", 
		"OPER_2", "OPER_3", "OPER_4", "'not'", "WS", "TNAME", "NAME", "STRING", 
		"INT", "FLOAT"
	};
	public static final int
		RULE_prog = 0, RULE_line = 1, RULE_block = 2, RULE_function_call = 3, 
		RULE_struct_def = 4, RULE_type_list = 5, RULE_typed_var = 6, RULE_type = 7, 
		RULE_variable = 8, RULE_if_block = 9, RULE_elif_block = 10, RULE_expr = 11, 
		RULE_expr_list = 12, RULE_primitive = 13, RULE_function = 14, RULE_arg_list = 15;
	public static final String[] ruleNames = {
		"prog", "line", "block", "function_call", "struct_def", "type_list", "typed_var", 
		"type", "variable", "if_block", "elif_block", "expr", "expr_list", "primitive", 
		"function", "arg_list"
	};

	@Override
	public String getGrammarFileName() { return "Wezlang.g4"; }

	@Override
	public String[] getTokenNames() { return tokenNames; }

	@Override
	public String[] getRuleNames() { return ruleNames; }

	@Override
	public ATN getATN() { return _ATN; }

	public WezlangParser(TokenStream input) {
		super(input);
		_interp = new ParserATNSimulator(this,_ATN,_decisionToDFA,_sharedContextCache);
	}
	public static class ProgContext extends ParserRuleContext {
		public Struct_defContext struct_def(int i) {
			return getRuleContext(Struct_defContext.class,i);
		}
		public LineContext line(int i) {
			return getRuleContext(LineContext.class,i);
		}
		public List<LineContext> line() {
			return getRuleContexts(LineContext.class);
		}
		public List<Struct_defContext> struct_def() {
			return getRuleContexts(Struct_defContext.class);
		}
		public ProgContext(ParserRuleContext parent, int invokingState) {
			super(parent, invokingState);
		}
		@Override public int getRuleIndex() { return RULE_prog; }
		@Override
		public void enterRule(ParseTreeListener listener) {
			if ( listener instanceof WezlangListener ) ((WezlangListener)listener).enterProg(this);
		}
		@Override
		public void exitRule(ParseTreeListener listener) {
			if ( listener instanceof WezlangListener ) ((WezlangListener)listener).exitProg(this);
		}
	}

	public final ProgContext prog() throws RecognitionException {
		ProgContext _localctx = new ProgContext(_ctx, getState());
		enterRule(_localctx, 0, RULE_prog);
		int _la;
		try {
			enterOuterAlt(_localctx, 1);
			{
			setState(34); 
			_errHandler.sync(this);
			_la = _input.LA(1);
			do {
				{
				setState(34);
				switch (_input.LA(1)) {
				case 5:
				case IF:
				case BOOL:
				case OPER_R:
				case NAME:
				case STRING:
				case INT:
				case FLOAT:
					{
					setState(32); line();
					}
					break;
				case STRUCT:
					{
					setState(33); struct_def();
					}
					break;
				default:
					throw new NoViableAltException(this);
				}
				}
				setState(36); 
				_errHandler.sync(this);
				_la = _input.LA(1);
			} while ( (((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << 5) | (1L << IF) | (1L << STRUCT) | (1L << BOOL) | (1L << OPER_R) | (1L << NAME) | (1L << STRING) | (1L << INT) | (1L << FLOAT))) != 0) );
			}
		}
		catch (RecognitionException re) {
			_localctx.exception = re;
			_errHandler.reportError(this, re);
			_errHandler.recover(this, re);
		}
		finally {
			exitRule();
		}
		return _localctx;
	}

	public static class LineContext extends ParserRuleContext {
		public If_blockContext if_block() {
			return getRuleContext(If_blockContext.class,0);
		}
		public Typed_varContext typed_var() {
			return getRuleContext(Typed_varContext.class,0);
		}
		public ExprContext expr() {
			return getRuleContext(ExprContext.class,0);
		}
		public VariableContext variable() {
			return getRuleContext(VariableContext.class,0);
		}
		public LineContext(ParserRuleContext parent, int invokingState) {
			super(parent, invokingState);
		}
		@Override public int getRuleIndex() { return RULE_line; }
		@Override
		public void enterRule(ParseTreeListener listener) {
			if ( listener instanceof WezlangListener ) ((WezlangListener)listener).enterLine(this);
		}
		@Override
		public void exitRule(ParseTreeListener listener) {
			if ( listener instanceof WezlangListener ) ((WezlangListener)listener).exitLine(this);
		}
	}

	public final LineContext line() throws RecognitionException {
		LineContext _localctx = new LineContext(_ctx, getState());
		enterRule(_localctx, 2, RULE_line);
		try {
			setState(48);
			switch ( getInterpreter().adaptivePredict(_input,2,_ctx) ) {
			case 1:
				enterOuterAlt(_localctx, 1);
				{
				setState(38); variable();
				setState(39); match(9);
				}
				break;

			case 2:
				enterOuterAlt(_localctx, 2);
				{
				setState(41); if_block();
				}
				break;

			case 3:
				enterOuterAlt(_localctx, 3);
				{
				setState(42); typed_var();
				setState(43); match(9);
				}
				break;

			case 4:
				enterOuterAlt(_localctx, 4);
				{
				setState(45); expr(0);
				setState(46); match(9);
				}
				break;
			}
		}
		catch (RecognitionException re) {
			_localctx.exception = re;
			_errHandler.reportError(this, re);
			_errHandler.recover(this, re);
		}
		finally {
			exitRule();
		}
		return _localctx;
	}

	public static class BlockContext extends ParserRuleContext {
		public LineContext line(int i) {
			return getRuleContext(LineContext.class,i);
		}
		public List<LineContext> line() {
			return getRuleContexts(LineContext.class);
		}
		public BlockContext(ParserRuleContext parent, int invokingState) {
			super(parent, invokingState);
		}
		@Override public int getRuleIndex() { return RULE_block; }
		@Override
		public void enterRule(ParseTreeListener listener) {
			if ( listener instanceof WezlangListener ) ((WezlangListener)listener).enterBlock(this);
		}
		@Override
		public void exitRule(ParseTreeListener listener) {
			if ( listener instanceof WezlangListener ) ((WezlangListener)listener).exitBlock(this);
		}
	}

	public final BlockContext block() throws RecognitionException {
		BlockContext _localctx = new BlockContext(_ctx, getState());
		enterRule(_localctx, 4, RULE_block);
		int _la;
		try {
			enterOuterAlt(_localctx, 1);
			{
			setState(53);
			_errHandler.sync(this);
			_la = _input.LA(1);
			while ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << 5) | (1L << IF) | (1L << BOOL) | (1L << OPER_R) | (1L << NAME) | (1L << STRING) | (1L << INT) | (1L << FLOAT))) != 0)) {
				{
				{
				setState(50); line();
				}
				}
				setState(55);
				_errHandler.sync(this);
				_la = _input.LA(1);
			}
			}
		}
		catch (RecognitionException re) {
			_localctx.exception = re;
			_errHandler.reportError(this, re);
			_errHandler.recover(this, re);
		}
		finally {
			exitRule();
		}
		return _localctx;
	}

	public static class Function_callContext extends ParserRuleContext {
		public TerminalNode NAME() { return getToken(WezlangParser.NAME, 0); }
		public Expr_listContext expr_list() {
			return getRuleContext(Expr_listContext.class,0);
		}
		public Function_callContext(ParserRuleContext parent, int invokingState) {
			super(parent, invokingState);
		}
		@Override public int getRuleIndex() { return RULE_function_call; }
		@Override
		public void enterRule(ParseTreeListener listener) {
			if ( listener instanceof WezlangListener ) ((WezlangListener)listener).enterFunction_call(this);
		}
		@Override
		public void exitRule(ParseTreeListener listener) {
			if ( listener instanceof WezlangListener ) ((WezlangListener)listener).exitFunction_call(this);
		}
	}

	public final Function_callContext function_call() throws RecognitionException {
		Function_callContext _localctx = new Function_callContext(_ctx, getState());
		enterRule(_localctx, 6, RULE_function_call);
		try {
			setState(64);
			switch ( getInterpreter().adaptivePredict(_input,4,_ctx) ) {
			case 1:
				enterOuterAlt(_localctx, 1);
				{
				setState(56); match(NAME);
				setState(57); match(5);
				setState(58); match(3);
				}
				break;

			case 2:
				enterOuterAlt(_localctx, 2);
				{
				setState(59); match(NAME);
				setState(60); match(5);
				setState(61); expr_list();
				setState(62); match(3);
				}
				break;
			}
		}
		catch (RecognitionException re) {
			_localctx.exception = re;
			_errHandler.reportError(this, re);
			_errHandler.recover(this, re);
		}
		finally {
			exitRule();
		}
		return _localctx;
	}

	public static class Struct_defContext extends ParserRuleContext {
		public TerminalNode STRUCT() { return getToken(WezlangParser.STRUCT, 0); }
		public TerminalNode TNAME() { return getToken(WezlangParser.TNAME, 0); }
		public List<Typed_varContext> typed_var() {
			return getRuleContexts(Typed_varContext.class);
		}
		public Typed_varContext typed_var(int i) {
			return getRuleContext(Typed_varContext.class,i);
		}
		public Struct_defContext(ParserRuleContext parent, int invokingState) {
			super(parent, invokingState);
		}
		@Override public int getRuleIndex() { return RULE_struct_def; }
		@Override
		public void enterRule(ParseTreeListener listener) {
			if ( listener instanceof WezlangListener ) ((WezlangListener)listener).enterStruct_def(this);
		}
		@Override
		public void exitRule(ParseTreeListener listener) {
			if ( listener instanceof WezlangListener ) ((WezlangListener)listener).exitStruct_def(this);
		}
	}

	public final Struct_defContext struct_def() throws RecognitionException {
		Struct_defContext _localctx = new Struct_defContext(_ctx, getState());
		enterRule(_localctx, 8, RULE_struct_def);
		int _la;
		try {
			enterOuterAlt(_localctx, 1);
			{
			setState(66); match(STRUCT);
			setState(67); match(TNAME);
			setState(68); match(2);
			setState(74);
			_errHandler.sync(this);
			_la = _input.LA(1);
			while (_la==NAME) {
				{
				{
				setState(69); typed_var();
				setState(70); match(9);
				}
				}
				setState(76);
				_errHandler.sync(this);
				_la = _input.LA(1);
			}
			setState(77); match(8);
			}
		}
		catch (RecognitionException re) {
			_localctx.exception = re;
			_errHandler.reportError(this, re);
			_errHandler.recover(this, re);
		}
		finally {
			exitRule();
		}
		return _localctx;
	}

	public static class Type_listContext extends ParserRuleContext {
		public Typed_varContext typed_var() {
			return getRuleContext(Typed_varContext.class,0);
		}
		public Type_listContext type_list() {
			return getRuleContext(Type_listContext.class,0);
		}
		public Type_listContext(ParserRuleContext parent, int invokingState) {
			super(parent, invokingState);
		}
		@Override public int getRuleIndex() { return RULE_type_list; }
		@Override
		public void enterRule(ParseTreeListener listener) {
			if ( listener instanceof WezlangListener ) ((WezlangListener)listener).enterType_list(this);
		}
		@Override
		public void exitRule(ParseTreeListener listener) {
			if ( listener instanceof WezlangListener ) ((WezlangListener)listener).exitType_list(this);
		}
	}

	public final Type_listContext type_list() throws RecognitionException {
		Type_listContext _localctx = new Type_listContext(_ctx, getState());
		enterRule(_localctx, 10, RULE_type_list);
		try {
			setState(84);
			switch ( getInterpreter().adaptivePredict(_input,6,_ctx) ) {
			case 1:
				enterOuterAlt(_localctx, 1);
				{
				setState(79); typed_var();
				setState(80); match(4);
				setState(81); type_list();
				}
				break;

			case 2:
				enterOuterAlt(_localctx, 2);
				{
				setState(83); typed_var();
				}
				break;
			}
		}
		catch (RecognitionException re) {
			_localctx.exception = re;
			_errHandler.reportError(this, re);
			_errHandler.recover(this, re);
		}
		finally {
			exitRule();
		}
		return _localctx;
	}

	public static class Typed_varContext extends ParserRuleContext {
		public TerminalNode NAME() { return getToken(WezlangParser.NAME, 0); }
		public TypeContext type() {
			return getRuleContext(TypeContext.class,0);
		}
		public Typed_varContext(ParserRuleContext parent, int invokingState) {
			super(parent, invokingState);
		}
		@Override public int getRuleIndex() { return RULE_typed_var; }
		@Override
		public void enterRule(ParseTreeListener listener) {
			if ( listener instanceof WezlangListener ) ((WezlangListener)listener).enterTyped_var(this);
		}
		@Override
		public void exitRule(ParseTreeListener listener) {
			if ( listener instanceof WezlangListener ) ((WezlangListener)listener).exitTyped_var(this);
		}
	}

	public final Typed_varContext typed_var() throws RecognitionException {
		Typed_varContext _localctx = new Typed_varContext(_ctx, getState());
		enterRule(_localctx, 12, RULE_typed_var);
		try {
			enterOuterAlt(_localctx, 1);
			{
			setState(86); match(NAME);
			setState(87); match(6);
			setState(88); type(0);
			}
		}
		catch (RecognitionException re) {
			_localctx.exception = re;
			_errHandler.reportError(this, re);
			_errHandler.recover(this, re);
		}
		finally {
			exitRule();
		}
		return _localctx;
	}

	public static class TypeContext extends ParserRuleContext {
		public int _p;
		public TerminalNode TNAME() { return getToken(WezlangParser.TNAME, 0); }
		public TypeContext type(int i) {
			return getRuleContext(TypeContext.class,i);
		}
		public List<TypeContext> type() {
			return getRuleContexts(TypeContext.class);
		}
		public TypeContext(ParserRuleContext parent, int invokingState) { super(parent, invokingState); }
		public TypeContext(ParserRuleContext parent, int invokingState, int _p) {
			super(parent, invokingState);
			this._p = _p;
		}
		@Override public int getRuleIndex() { return RULE_type; }
		@Override
		public void enterRule(ParseTreeListener listener) {
			if ( listener instanceof WezlangListener ) ((WezlangListener)listener).enterType(this);
		}
		@Override
		public void exitRule(ParseTreeListener listener) {
			if ( listener instanceof WezlangListener ) ((WezlangListener)listener).exitType(this);
		}
	}

	public final TypeContext type(int _p) throws RecognitionException {
		ParserRuleContext _parentctx = _ctx;
		int _parentState = getState();
		TypeContext _localctx = new TypeContext(_ctx, _parentState, _p);
		TypeContext _prevctx = _localctx;
		int _startState = 14;
		enterRecursionRule(_localctx, RULE_type);
		try {
			int _alt;
			enterOuterAlt(_localctx, 1);
			{
			setState(96);
			switch (_input.LA(1)) {
			case 5:
				{
				setState(91); match(5);
				setState(92); type(0);
				setState(93); match(3);
				}
				break;
			case TNAME:
				{
				setState(95); match(TNAME);
				}
				break;
			default:
				throw new NoViableAltException(this);
			}
			_ctx.stop = _input.LT(-1);
			setState(107);
			_errHandler.sync(this);
			_alt = getInterpreter().adaptivePredict(_input,9,_ctx);
			while ( _alt!=2 && _alt!=-1 ) {
				if ( _alt==1 ) {
					if ( _parseListeners!=null ) triggerExitRuleEvent();
					_prevctx = _localctx;
					{
					{
					_localctx = new TypeContext(_parentctx, _parentState, _p);
					pushNewRecursionContext(_localctx, _startState, RULE_type);
					setState(98);
					if (!(2 >= _localctx._p)) throw new FailedPredicateException(this, "2 >= $_p");
					setState(101); 
					_errHandler.sync(this);
					_alt = getInterpreter().adaptivePredict(_input,8,_ctx);
					do {
						switch (_alt) {
						case 1:
							{
							{
							setState(99); match(1);
							setState(100); type(0);
							}
							}
							break;
						default:
							throw new NoViableAltException(this);
						}
						setState(103); 
						_errHandler.sync(this);
						_alt = getInterpreter().adaptivePredict(_input,8,_ctx);
					} while ( _alt!=2 && _alt!=-1 );
					}
					} 
				}
				setState(109);
				_errHandler.sync(this);
				_alt = getInterpreter().adaptivePredict(_input,9,_ctx);
			}
			}
		}
		catch (RecognitionException re) {
			_localctx.exception = re;
			_errHandler.reportError(this, re);
			_errHandler.recover(this, re);
		}
		finally {
			unrollRecursionContexts(_parentctx);
		}
		return _localctx;
	}

	public static class VariableContext extends ParserRuleContext {
		public TerminalNode NAME() { return getToken(WezlangParser.NAME, 0); }
		public ExprContext expr() {
			return getRuleContext(ExprContext.class,0);
		}
		public VariableContext(ParserRuleContext parent, int invokingState) {
			super(parent, invokingState);
		}
		@Override public int getRuleIndex() { return RULE_variable; }
		@Override
		public void enterRule(ParseTreeListener listener) {
			if ( listener instanceof WezlangListener ) ((WezlangListener)listener).enterVariable(this);
		}
		@Override
		public void exitRule(ParseTreeListener listener) {
			if ( listener instanceof WezlangListener ) ((WezlangListener)listener).exitVariable(this);
		}
	}

	public final VariableContext variable() throws RecognitionException {
		VariableContext _localctx = new VariableContext(_ctx, getState());
		enterRule(_localctx, 16, RULE_variable);
		try {
			enterOuterAlt(_localctx, 1);
			{
			setState(110); match(NAME);
			setState(111); match(7);
			setState(112); expr(0);
			}
		}
		catch (RecognitionException re) {
			_localctx.exception = re;
			_errHandler.reportError(this, re);
			_errHandler.recover(this, re);
		}
		finally {
			exitRule();
		}
		return _localctx;
	}

	public static class If_blockContext extends ParserRuleContext {
		public Elif_blockContext elif_block() {
			return getRuleContext(Elif_blockContext.class,0);
		}
		public BlockContext block() {
			return getRuleContext(BlockContext.class,0);
		}
		public ExprContext expr() {
			return getRuleContext(ExprContext.class,0);
		}
		public TerminalNode IF() { return getToken(WezlangParser.IF, 0); }
		public If_blockContext(ParserRuleContext parent, int invokingState) {
			super(parent, invokingState);
		}
		@Override public int getRuleIndex() { return RULE_if_block; }
		@Override
		public void enterRule(ParseTreeListener listener) {
			if ( listener instanceof WezlangListener ) ((WezlangListener)listener).enterIf_block(this);
		}
		@Override
		public void exitRule(ParseTreeListener listener) {
			if ( listener instanceof WezlangListener ) ((WezlangListener)listener).exitIf_block(this);
		}
	}

	public final If_blockContext if_block() throws RecognitionException {
		If_blockContext _localctx = new If_blockContext(_ctx, getState());
		enterRule(_localctx, 18, RULE_if_block);
		try {
			enterOuterAlt(_localctx, 1);
			{
			setState(114); match(IF);
			setState(115); expr(0);
			setState(116); match(2);
			setState(117); block();
			setState(118); match(8);
			setState(119); elif_block();
			}
		}
		catch (RecognitionException re) {
			_localctx.exception = re;
			_errHandler.reportError(this, re);
			_errHandler.recover(this, re);
		}
		finally {
			exitRule();
		}
		return _localctx;
	}

	public static class Elif_blockContext extends ParserRuleContext {
		public BlockContext block(int i) {
			return getRuleContext(BlockContext.class,i);
		}
		public List<TerminalNode> ELIF() { return getTokens(WezlangParser.ELIF); }
		public ExprContext expr(int i) {
			return getRuleContext(ExprContext.class,i);
		}
		public List<BlockContext> block() {
			return getRuleContexts(BlockContext.class);
		}
		public List<ExprContext> expr() {
			return getRuleContexts(ExprContext.class);
		}
		public TerminalNode ELIF(int i) {
			return getToken(WezlangParser.ELIF, i);
		}
		public TerminalNode ELSE() { return getToken(WezlangParser.ELSE, 0); }
		public Elif_blockContext(ParserRuleContext parent, int invokingState) {
			super(parent, invokingState);
		}
		@Override public int getRuleIndex() { return RULE_elif_block; }
		@Override
		public void enterRule(ParseTreeListener listener) {
			if ( listener instanceof WezlangListener ) ((WezlangListener)listener).enterElif_block(this);
		}
		@Override
		public void exitRule(ParseTreeListener listener) {
			if ( listener instanceof WezlangListener ) ((WezlangListener)listener).exitElif_block(this);
		}
	}

	public final Elif_blockContext elif_block() throws RecognitionException {
		Elif_blockContext _localctx = new Elif_blockContext(_ctx, getState());
		enterRule(_localctx, 20, RULE_elif_block);
		int _la;
		try {
			setState(148);
			switch ( getInterpreter().adaptivePredict(_input,12,_ctx) ) {
			case 1:
				enterOuterAlt(_localctx, 1);
				{
				setState(129);
				_errHandler.sync(this);
				_la = _input.LA(1);
				while (_la==ELIF) {
					{
					{
					setState(121); match(ELIF);
					setState(122); expr(0);
					setState(123); match(2);
					setState(124); block();
					setState(125); match(8);
					}
					}
					setState(131);
					_errHandler.sync(this);
					_la = _input.LA(1);
				}
				setState(132); match(ELSE);
				setState(133); match(2);
				setState(134); block();
				setState(135); match(8);
				}
				break;

			case 2:
				enterOuterAlt(_localctx, 2);
				{
				setState(145);
				_errHandler.sync(this);
				_la = _input.LA(1);
				while (_la==ELIF) {
					{
					{
					setState(137); match(ELIF);
					setState(138); expr(0);
					setState(139); match(2);
					setState(140); block();
					setState(141); match(8);
					}
					}
					setState(147);
					_errHandler.sync(this);
					_la = _input.LA(1);
				}
				}
				break;
			}
		}
		catch (RecognitionException re) {
			_localctx.exception = re;
			_errHandler.reportError(this, re);
			_errHandler.recover(this, re);
		}
		finally {
			exitRule();
		}
		return _localctx;
	}

	public static class ExprContext extends ParserRuleContext {
		public int _p;
		public TerminalNode NAME() { return getToken(WezlangParser.NAME, 0); }
		public Function_callContext function_call() {
			return getRuleContext(Function_callContext.class,0);
		}
		public TerminalNode OPER_3() { return getToken(WezlangParser.OPER_3, 0); }
		public ExprContext expr(int i) {
			return getRuleContext(ExprContext.class,i);
		}
		public TerminalNode OPER_4() { return getToken(WezlangParser.OPER_4, 0); }
		public TerminalNode OPER_R() { return getToken(WezlangParser.OPER_R, 0); }
		public TerminalNode OPER_1() { return getToken(WezlangParser.OPER_1, 0); }
		public List<ExprContext> expr() {
			return getRuleContexts(ExprContext.class);
		}
		public TerminalNode OPER_2() { return getToken(WezlangParser.OPER_2, 0); }
		public PrimitiveContext primitive() {
			return getRuleContext(PrimitiveContext.class,0);
		}
		public FunctionContext function() {
			return getRuleContext(FunctionContext.class,0);
		}
		public ExprContext(ParserRuleContext parent, int invokingState) { super(parent, invokingState); }
		public ExprContext(ParserRuleContext parent, int invokingState, int _p) {
			super(parent, invokingState);
			this._p = _p;
		}
		@Override public int getRuleIndex() { return RULE_expr; }
		@Override
		public void enterRule(ParseTreeListener listener) {
			if ( listener instanceof WezlangListener ) ((WezlangListener)listener).enterExpr(this);
		}
		@Override
		public void exitRule(ParseTreeListener listener) {
			if ( listener instanceof WezlangListener ) ((WezlangListener)listener).exitExpr(this);
		}
	}

	public final ExprContext expr(int _p) throws RecognitionException {
		ParserRuleContext _parentctx = _ctx;
		int _parentState = getState();
		ExprContext _localctx = new ExprContext(_ctx, _parentState, _p);
		ExprContext _prevctx = _localctx;
		int _startState = 22;
		enterRecursionRule(_localctx, RULE_expr);
		try {
			int _alt;
			enterOuterAlt(_localctx, 1);
			{
			setState(161);
			switch ( getInterpreter().adaptivePredict(_input,13,_ctx) ) {
			case 1:
				{
				setState(151); match(OPER_R);
				setState(152); expr(1);
				}
				break;

			case 2:
				{
				setState(153); match(5);
				setState(154); expr(0);
				setState(155); match(3);
				}
				break;

			case 3:
				{
				setState(157); primitive();
				}
				break;

			case 4:
				{
				setState(158); match(NAME);
				}
				break;

			case 5:
				{
				setState(159); function();
				}
				break;

			case 6:
				{
				setState(160); function_call();
				}
				break;
			}
			_ctx.stop = _input.LT(-1);
			setState(177);
			_errHandler.sync(this);
			_alt = getInterpreter().adaptivePredict(_input,15,_ctx);
			while ( _alt!=2 && _alt!=-1 ) {
				if ( _alt==1 ) {
					if ( _parseListeners!=null ) triggerExitRuleEvent();
					_prevctx = _localctx;
					{
					setState(175);
					switch ( getInterpreter().adaptivePredict(_input,14,_ctx) ) {
					case 1:
						{
						_localctx = new ExprContext(_parentctx, _parentState, _p);
						pushNewRecursionContext(_localctx, _startState, RULE_expr);
						setState(163);
						if (!(5 >= _localctx._p)) throw new FailedPredicateException(this, "5 >= $_p");
						setState(164); match(OPER_1);
						setState(165); expr(6);
						}
						break;

					case 2:
						{
						_localctx = new ExprContext(_parentctx, _parentState, _p);
						pushNewRecursionContext(_localctx, _startState, RULE_expr);
						setState(166);
						if (!(4 >= _localctx._p)) throw new FailedPredicateException(this, "4 >= $_p");
						setState(167); match(OPER_2);
						setState(168); expr(5);
						}
						break;

					case 3:
						{
						_localctx = new ExprContext(_parentctx, _parentState, _p);
						pushNewRecursionContext(_localctx, _startState, RULE_expr);
						setState(169);
						if (!(3 >= _localctx._p)) throw new FailedPredicateException(this, "3 >= $_p");
						setState(170); match(OPER_3);
						setState(171); expr(4);
						}
						break;

					case 4:
						{
						_localctx = new ExprContext(_parentctx, _parentState, _p);
						pushNewRecursionContext(_localctx, _startState, RULE_expr);
						setState(172);
						if (!(2 >= _localctx._p)) throw new FailedPredicateException(this, "2 >= $_p");
						setState(173); match(OPER_4);
						setState(174); expr(3);
						}
						break;
					}
					} 
				}
				setState(179);
				_errHandler.sync(this);
				_alt = getInterpreter().adaptivePredict(_input,15,_ctx);
			}
			}
		}
		catch (RecognitionException re) {
			_localctx.exception = re;
			_errHandler.reportError(this, re);
			_errHandler.recover(this, re);
		}
		finally {
			unrollRecursionContexts(_parentctx);
		}
		return _localctx;
	}

	public static class Expr_listContext extends ParserRuleContext {
		public ExprContext expr(int i) {
			return getRuleContext(ExprContext.class,i);
		}
		public List<ExprContext> expr() {
			return getRuleContexts(ExprContext.class);
		}
		public Expr_listContext(ParserRuleContext parent, int invokingState) {
			super(parent, invokingState);
		}
		@Override public int getRuleIndex() { return RULE_expr_list; }
		@Override
		public void enterRule(ParseTreeListener listener) {
			if ( listener instanceof WezlangListener ) ((WezlangListener)listener).enterExpr_list(this);
		}
		@Override
		public void exitRule(ParseTreeListener listener) {
			if ( listener instanceof WezlangListener ) ((WezlangListener)listener).exitExpr_list(this);
		}
	}

	public final Expr_listContext expr_list() throws RecognitionException {
		Expr_listContext _localctx = new Expr_listContext(_ctx, getState());
		enterRule(_localctx, 24, RULE_expr_list);
		int _la;
		try {
			setState(189);
			switch (_input.LA(1)) {
			case 5:
			case BOOL:
			case OPER_R:
			case NAME:
			case STRING:
			case INT:
			case FLOAT:
				enterOuterAlt(_localctx, 1);
				{
				setState(180); expr(0);
				setState(185);
				_errHandler.sync(this);
				_la = _input.LA(1);
				while (_la==4) {
					{
					{
					setState(181); match(4);
					setState(182); expr(0);
					}
					}
					setState(187);
					_errHandler.sync(this);
					_la = _input.LA(1);
				}
				}
				break;
			case 3:
				enterOuterAlt(_localctx, 2);
				{
				}
				break;
			default:
				throw new NoViableAltException(this);
			}
		}
		catch (RecognitionException re) {
			_localctx.exception = re;
			_errHandler.reportError(this, re);
			_errHandler.recover(this, re);
		}
		finally {
			exitRule();
		}
		return _localctx;
	}

	public static class PrimitiveContext extends ParserRuleContext {
		public TerminalNode FLOAT() { return getToken(WezlangParser.FLOAT, 0); }
		public TerminalNode INT() { return getToken(WezlangParser.INT, 0); }
		public TerminalNode STRING() { return getToken(WezlangParser.STRING, 0); }
		public TerminalNode BOOL() { return getToken(WezlangParser.BOOL, 0); }
		public PrimitiveContext(ParserRuleContext parent, int invokingState) {
			super(parent, invokingState);
		}
		@Override public int getRuleIndex() { return RULE_primitive; }
		@Override
		public void enterRule(ParseTreeListener listener) {
			if ( listener instanceof WezlangListener ) ((WezlangListener)listener).enterPrimitive(this);
		}
		@Override
		public void exitRule(ParseTreeListener listener) {
			if ( listener instanceof WezlangListener ) ((WezlangListener)listener).exitPrimitive(this);
		}
	}

	public final PrimitiveContext primitive() throws RecognitionException {
		PrimitiveContext _localctx = new PrimitiveContext(_ctx, getState());
		enterRule(_localctx, 26, RULE_primitive);
		int _la;
		try {
			enterOuterAlt(_localctx, 1);
			{
			setState(191);
			_la = _input.LA(1);
			if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << BOOL) | (1L << STRING) | (1L << INT) | (1L << FLOAT))) != 0)) ) {
			_errHandler.recoverInline(this);
			}
			consume();
			}
		}
		catch (RecognitionException re) {
			_localctx.exception = re;
			_errHandler.reportError(this, re);
			_errHandler.recover(this, re);
		}
		finally {
			exitRule();
		}
		return _localctx;
	}

	public static class FunctionContext extends ParserRuleContext {
		public Arg_listContext arg_list() {
			return getRuleContext(Arg_listContext.class,0);
		}
		public LineContext line(int i) {
			return getRuleContext(LineContext.class,i);
		}
		public List<LineContext> line() {
			return getRuleContexts(LineContext.class);
		}
		public FunctionContext(ParserRuleContext parent, int invokingState) {
			super(parent, invokingState);
		}
		@Override public int getRuleIndex() { return RULE_function; }
		@Override
		public void enterRule(ParseTreeListener listener) {
			if ( listener instanceof WezlangListener ) ((WezlangListener)listener).enterFunction(this);
		}
		@Override
		public void exitRule(ParseTreeListener listener) {
			if ( listener instanceof WezlangListener ) ((WezlangListener)listener).exitFunction(this);
		}
	}

	public final FunctionContext function() throws RecognitionException {
		FunctionContext _localctx = new FunctionContext(_ctx, getState());
		enterRule(_localctx, 28, RULE_function);
		int _la;
		try {
			enterOuterAlt(_localctx, 1);
			{
			setState(193); match(5);
			setState(194); arg_list();
			setState(195); match(3);
			setState(196); match(2);
			setState(200);
			_errHandler.sync(this);
			_la = _input.LA(1);
			while ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << 5) | (1L << IF) | (1L << BOOL) | (1L << OPER_R) | (1L << NAME) | (1L << STRING) | (1L << INT) | (1L << FLOAT))) != 0)) {
				{
				{
				setState(197); line();
				}
				}
				setState(202);
				_errHandler.sync(this);
				_la = _input.LA(1);
			}
			setState(203); match(8);
			}
		}
		catch (RecognitionException re) {
			_localctx.exception = re;
			_errHandler.reportError(this, re);
			_errHandler.recover(this, re);
		}
		finally {
			exitRule();
		}
		return _localctx;
	}

	public static class Arg_listContext extends ParserRuleContext {
		public List<TerminalNode> NAME() { return getTokens(WezlangParser.NAME); }
		public TerminalNode NAME(int i) {
			return getToken(WezlangParser.NAME, i);
		}
		public Arg_listContext(ParserRuleContext parent, int invokingState) {
			super(parent, invokingState);
		}
		@Override public int getRuleIndex() { return RULE_arg_list; }
		@Override
		public void enterRule(ParseTreeListener listener) {
			if ( listener instanceof WezlangListener ) ((WezlangListener)listener).enterArg_list(this);
		}
		@Override
		public void exitRule(ParseTreeListener listener) {
			if ( listener instanceof WezlangListener ) ((WezlangListener)listener).exitArg_list(this);
		}
	}

	public final Arg_listContext arg_list() throws RecognitionException {
		Arg_listContext _localctx = new Arg_listContext(_ctx, getState());
		enterRule(_localctx, 30, RULE_arg_list);
		int _la;
		try {
			setState(214);
			switch (_input.LA(1)) {
			case NAME:
				enterOuterAlt(_localctx, 1);
				{
				setState(205); match(NAME);
				setState(210);
				_errHandler.sync(this);
				_la = _input.LA(1);
				while (_la==4) {
					{
					{
					setState(206); match(4);
					setState(207); match(NAME);
					}
					}
					setState(212);
					_errHandler.sync(this);
					_la = _input.LA(1);
				}
				}
				break;
			case 3:
				enterOuterAlt(_localctx, 2);
				{
				}
				break;
			default:
				throw new NoViableAltException(this);
			}
		}
		catch (RecognitionException re) {
			_localctx.exception = re;
			_errHandler.reportError(this, re);
			_errHandler.recover(this, re);
		}
		finally {
			exitRule();
		}
		return _localctx;
	}

	public boolean sempred(RuleContext _localctx, int ruleIndex, int predIndex) {
		switch (ruleIndex) {
		case 7: return type_sempred((TypeContext)_localctx, predIndex);

		case 11: return expr_sempred((ExprContext)_localctx, predIndex);
		}
		return true;
	}
	private boolean expr_sempred(ExprContext _localctx, int predIndex) {
		switch (predIndex) {
		case 1: return 5 >= _localctx._p;

		case 2: return 4 >= _localctx._p;

		case 3: return 3 >= _localctx._p;

		case 4: return 2 >= _localctx._p;
		}
		return true;
	}
	private boolean type_sempred(TypeContext _localctx, int predIndex) {
		switch (predIndex) {
		case 0: return 2 >= _localctx._p;
		}
		return true;
	}

	public static final String _serializedATN =
		"\2\3\34\u00db\4\2\t\2\4\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7\t\7\4\b\t\b"+
		"\4\t\t\t\4\n\t\n\4\13\t\13\4\f\t\f\4\r\t\r\4\16\t\16\4\17\t\17\4\20\t"+
		"\20\4\21\t\21\3\2\3\2\6\2%\n\2\r\2\16\2&\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3"+
		"\3\3\3\3\3\5\3\63\n\3\3\4\7\4\66\n\4\f\4\16\49\13\4\3\5\3\5\3\5\3\5\3"+
		"\5\3\5\3\5\3\5\5\5C\n\5\3\6\3\6\3\6\3\6\3\6\3\6\7\6K\n\6\f\6\16\6N\13"+
		"\6\3\6\3\6\3\7\3\7\3\7\3\7\3\7\5\7W\n\7\3\b\3\b\3\b\3\b\3\t\3\t\3\t\3"+
		"\t\3\t\3\t\5\tc\n\t\3\t\3\t\3\t\6\th\n\t\r\t\16\ti\7\tl\n\t\f\t\16\to"+
		"\13\t\3\n\3\n\3\n\3\n\3\13\3\13\3\13\3\13\3\13\3\13\3\13\3\f\3\f\3\f\3"+
		"\f\3\f\3\f\7\f\u0082\n\f\f\f\16\f\u0085\13\f\3\f\3\f\3\f\3\f\3\f\3\f\3"+
		"\f\3\f\3\f\3\f\3\f\7\f\u0092\n\f\f\f\16\f\u0095\13\f\5\f\u0097\n\f\3\r"+
		"\3\r\3\r\3\r\3\r\3\r\3\r\3\r\3\r\3\r\3\r\5\r\u00a4\n\r\3\r\3\r\3\r\3\r"+
		"\3\r\3\r\3\r\3\r\3\r\3\r\3\r\3\r\7\r\u00b2\n\r\f\r\16\r\u00b5\13\r\3\16"+
		"\3\16\3\16\7\16\u00ba\n\16\f\16\16\16\u00bd\13\16\3\16\5\16\u00c0\n\16"+
		"\3\17\3\17\3\20\3\20\3\20\3\20\3\20\7\20\u00c9\n\20\f\20\16\20\u00cc\13"+
		"\20\3\20\3\20\3\21\3\21\3\21\7\21\u00d3\n\21\f\21\16\21\u00d6\13\21\3"+
		"\21\5\21\u00d9\n\21\3\21\2\22\2\4\6\b\n\f\16\20\22\24\26\30\32\34\36 "+
		"\2\3\4\21\21\32\34\u00e7\2$\3\2\2\2\4\62\3\2\2\2\6\67\3\2\2\2\bB\3\2\2"+
		"\2\nD\3\2\2\2\fV\3\2\2\2\16X\3\2\2\2\20b\3\2\2\2\22p\3\2\2\2\24t\3\2\2"+
		"\2\26\u0096\3\2\2\2\30\u00a3\3\2\2\2\32\u00bf\3\2\2\2\34\u00c1\3\2\2\2"+
		"\36\u00c3\3\2\2\2 \u00d8\3\2\2\2\"%\5\4\3\2#%\5\n\6\2$\"\3\2\2\2$#\3\2"+
		"\2\2%&\3\2\2\2&$\3\2\2\2&\'\3\2\2\2\'\3\3\2\2\2()\5\22\n\2)*\7\13\2\2"+
		"*\63\3\2\2\2+\63\5\24\13\2,-\5\16\b\2-.\7\13\2\2.\63\3\2\2\2/\60\5\30"+
		"\r\2\60\61\7\13\2\2\61\63\3\2\2\2\62(\3\2\2\2\62+\3\2\2\2\62,\3\2\2\2"+
		"\62/\3\2\2\2\63\5\3\2\2\2\64\66\5\4\3\2\65\64\3\2\2\2\669\3\2\2\2\67\65"+
		"\3\2\2\2\678\3\2\2\28\7\3\2\2\29\67\3\2\2\2:;\7\31\2\2;<\7\7\2\2<C\7\5"+
		"\2\2=>\7\31\2\2>?\7\7\2\2?@\5\32\16\2@A\7\5\2\2AC\3\2\2\2B:\3\2\2\2B="+
		"\3\2\2\2C\t\3\2\2\2DE\7\20\2\2EF\7\30\2\2FL\7\4\2\2GH\5\16\b\2HI\7\13"+
		"\2\2IK\3\2\2\2JG\3\2\2\2KN\3\2\2\2LJ\3\2\2\2LM\3\2\2\2MO\3\2\2\2NL\3\2"+
		"\2\2OP\7\n\2\2P\13\3\2\2\2QR\5\16\b\2RS\7\6\2\2ST\5\f\7\2TW\3\2\2\2UW"+
		"\5\16\b\2VQ\3\2\2\2VU\3\2\2\2W\r\3\2\2\2XY\7\31\2\2YZ\7\b\2\2Z[\5\20\t"+
		"\2[\17\3\2\2\2\\]\b\t\1\2]^\7\7\2\2^_\5\20\t\2_`\7\5\2\2`c\3\2\2\2ac\7"+
		"\30\2\2b\\\3\2\2\2ba\3\2\2\2cm\3\2\2\2dg\6\t\2\3ef\7\3\2\2fh\5\20\t\2"+
		"ge\3\2\2\2hi\3\2\2\2ig\3\2\2\2ij\3\2\2\2jl\3\2\2\2kd\3\2\2\2lo\3\2\2\2"+
		"mk\3\2\2\2mn\3\2\2\2n\21\3\2\2\2om\3\2\2\2pq\7\31\2\2qr\7\t\2\2rs\5\30"+
		"\r\2s\23\3\2\2\2tu\7\r\2\2uv\5\30\r\2vw\7\4\2\2wx\5\6\4\2xy\7\n\2\2yz"+
		"\5\26\f\2z\25\3\2\2\2{|\7\17\2\2|}\5\30\r\2}~\7\4\2\2~\177\5\6\4\2\177"+
		"\u0080\7\n\2\2\u0080\u0082\3\2\2\2\u0081{\3\2\2\2\u0082\u0085\3\2\2\2"+
		"\u0083\u0081\3\2\2\2\u0083\u0084\3\2\2\2\u0084\u0086\3\2\2\2\u0085\u0083"+
		"\3\2\2\2\u0086\u0087\7\16\2\2\u0087\u0088\7\4\2\2\u0088\u0089\5\6\4\2"+
		"\u0089\u008a\7\n\2\2\u008a\u0097\3\2\2\2\u008b\u008c\7\17\2\2\u008c\u008d"+
		"\5\30\r\2\u008d\u008e\7\4\2\2\u008e\u008f\5\6\4\2\u008f\u0090\7\n\2\2"+
		"\u0090\u0092\3\2\2\2\u0091\u008b\3\2\2\2\u0092\u0095\3\2\2\2\u0093\u0091"+
		"\3\2\2\2\u0093\u0094\3\2\2\2\u0094\u0097\3\2\2\2\u0095\u0093\3\2\2\2\u0096"+
		"\u0083\3\2\2\2\u0096\u0093\3\2\2\2\u0097\27\3\2\2\2\u0098\u0099\b\r\1"+
		"\2\u0099\u009a\7\26\2\2\u009a\u00a4\5\30\r\2\u009b\u009c\7\7\2\2\u009c"+
		"\u009d\5\30\r\2\u009d\u009e\7\5\2\2\u009e\u00a4\3\2\2\2\u009f\u00a4\5"+
		"\34\17\2\u00a0\u00a4\7\31\2\2\u00a1\u00a4\5\36\20\2\u00a2\u00a4\5\b\5"+
		"\2\u00a3\u0098\3\2\2\2\u00a3\u009b\3\2\2\2\u00a3\u009f\3\2\2\2\u00a3\u00a0"+
		"\3\2\2\2\u00a3\u00a1\3\2\2\2\u00a3\u00a2\3\2\2\2\u00a4\u00b3\3\2\2\2\u00a5"+
		"\u00a6\6\r\3\3\u00a6\u00a7\7\22\2\2\u00a7\u00b2\5\30\r\2\u00a8\u00a9\6"+
		"\r\4\3\u00a9\u00aa\7\23\2\2\u00aa\u00b2\5\30\r\2\u00ab\u00ac\6\r\5\3\u00ac"+
		"\u00ad\7\24\2\2\u00ad\u00b2\5\30\r\2\u00ae\u00af\6\r\6\3\u00af\u00b0\7"+
		"\25\2\2\u00b0\u00b2\5\30\r\2\u00b1\u00a5\3\2\2\2\u00b1\u00a8\3\2\2\2\u00b1"+
		"\u00ab\3\2\2\2\u00b1\u00ae\3\2\2\2\u00b2\u00b5\3\2\2\2\u00b3\u00b1\3\2"+
		"\2\2\u00b3\u00b4\3\2\2\2\u00b4\31\3\2\2\2\u00b5\u00b3\3\2\2\2\u00b6\u00bb"+
		"\5\30\r\2\u00b7\u00b8\7\6\2\2\u00b8\u00ba\5\30\r\2\u00b9\u00b7\3\2\2\2"+
		"\u00ba\u00bd\3\2\2\2\u00bb\u00b9\3\2\2\2\u00bb\u00bc\3\2\2\2\u00bc\u00c0"+
		"\3\2\2\2\u00bd\u00bb\3\2\2\2\u00be\u00c0\3\2\2\2\u00bf\u00b6\3\2\2\2\u00bf"+
		"\u00be\3\2\2\2\u00c0\33\3\2\2\2\u00c1\u00c2\t\2\2\2\u00c2\35\3\2\2\2\u00c3"+
		"\u00c4\7\7\2\2\u00c4\u00c5\5 \21\2\u00c5\u00c6\7\5\2\2\u00c6\u00ca\7\4"+
		"\2\2\u00c7\u00c9\5\4\3\2\u00c8\u00c7\3\2\2\2\u00c9\u00cc\3\2\2\2\u00ca"+
		"\u00c8\3\2\2\2\u00ca\u00cb\3\2\2\2\u00cb\u00cd\3\2\2\2\u00cc\u00ca\3\2"+
		"\2\2\u00cd\u00ce\7\n\2\2\u00ce\37\3\2\2\2\u00cf\u00d4\7\31\2\2\u00d0\u00d1"+
		"\7\6\2\2\u00d1\u00d3\7\31\2\2\u00d2\u00d0\3\2\2\2\u00d3\u00d6\3\2\2\2"+
		"\u00d4\u00d2\3\2\2\2\u00d4\u00d5\3\2\2\2\u00d5\u00d9\3\2\2\2\u00d6\u00d4"+
		"\3\2\2\2\u00d7\u00d9\3\2\2\2\u00d8\u00cf\3\2\2\2\u00d8\u00d7\3\2\2\2\u00d9"+
		"!\3\2\2\2\27$&\62\67BLVbim\u0083\u0093\u0096\u00a3\u00b1\u00b3\u00bb\u00bf"+
		"\u00ca\u00d4\u00d8";
	public static final ATN _ATN =
		ATNSimulator.deserialize(_serializedATN.toCharArray());
	static {
		_decisionToDFA = new DFA[_ATN.getNumberOfDecisions()];
	}
}